import json

# 1. 读取 JSON 文件
with open('青春期女孩.json', 'r', encoding='utf-8') as f:
    data = json.load(f)  # data 是列表

# 2. 批量修改 type 和 category
for item in data:
    item['type'] = 'girl'          # 修改 type
    item['category'] = 'knowledge' # 修改 category

# 3. 写回 JSON 文件
with open('data1.json', 'w', encoding='utf-8') as f:
    json.dump(data, f, ensure_ascii=False, indent=2)

print("批量修改完成！")